
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
react-dnd-preview
Advanced tools
This project is a React component compatible with React DnD that can be used to emulate a Drag'n'Drop "ghost" when a Backend system doesn't have one (e.g. react-dnd-touch-backend
).
npm install react-dnd-preview
Just include the Preview
component close to the top component of your application (it places itself absolutely) and provide a function as the generator
prop.
This function will take 3 arguments: itemType
, item
(both defined by the DragSource
) and style
which will be used to position the preview element. The function needs to return something that React can render (React component, null
, etc).
See also the examples for more information.
import Preview from 'react-dnd-preview';
...
class App extends React.Component {
...
previewGenerator(itemType, item, style) {
return <div class="item-list__item" style={style}>{itemType}</div>;
}
...
render() {
return (
<div>
<ItemList />
<Preview generator={this.previewGenerator} />
</div>
);
}
}
MIT, Copyright (c) 2016-2018 Louis Brunner
FAQs
Preview component for React DnD
We found that react-dnd-preview demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.